<!--# layout("/common/layout.html",{"jsBase":"/js/"}){ -->
<!--# if(isNotEmpty(templatePath)){  -->
<blockquote class="layui-elem-quote">
<u><a href="${ctxPath}/core/file/downloadTemplate.do?path=${templatePath}">点击下载模板 </a></u>
</blockquote> 
<!--#}  -->
<!--# if(isNotEmpty(projectId)){  -->
<input type="hidden" value="${projectId}" id="projectId"/>
<!--#}  -->
<form class="layui-form layui-form-pane" id="updateForm">

<fieldset class="layui-elem-field layui-field-title" style="margin-top: 30px;">
  <legend>拖拽上传</legend>
</fieldset>
<div class="layui-upload-drag" id="test10">
  <i class="layui-icon"></i>
  <p>点击上传，或将文件拖拽到此处</p>
</div>



</form>
<!--#} -->

<script>
layui.use('upload', function(){
  var upload = layui.upload;
    var load;
  upload.render({
    elem: '#test10'
    ,accept: '${fileType!"file"}' //默认所有文件都允许
      ,exts:"xls|xlsx"
    ,url: '${uploadUrl}',
    data:{'projectId':$('#projectId').val()}
      ,before:function () {
          load = parent.layer.load(1, {
              shade: [0.3,'#000'] //0.1透明度的背景
          });
      }
    ,done: function(res){
          parent.layer.close(load);
      if(res.code==0){
          var fun="${fun}";
          if(fun)
              eval('parent.window.'+fun+'()');
      	Common.openConfirm("上传成功,是否继续上传?",null,function(){
			var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
            parent.layer.close(index);
        })
      }else{
      	Common.error(res.msg);
        var fun="${fun}";
        if(fun)
          eval('parent.window.'+fun+'()');
      }
    }
    ,error:function () {
          parent.layer.close(load);
      }
   
  });
  
 });

</script>
